<div class="full_w">
    <div class="h_title"><?php echo Yii::t('AdmincpModule.admincp', 'Update Category'); ?></div>
     <?php 
        foreach(Yii::app()->admin->getFlashes() as $key => $message){
            echo '<div class="n_'.$key.'"><p>'.$message."</p></div>\n";
        }
    ?>
    <form action="" method="post">
        <div class="element">
            <label for="category_code">Code: <span class="red">(required)</span></label>
            <input type="text" name="category[category_code]" id="category_code" class="text required" value="<?php echo isset($arrItemInfo['category_code'])?$arrItemInfo['category_code']:null; ?>">
        </div>
        <div class="element">
            <label for="category_name">Name: <span class="red">(required)</span></label>
            <input type="text" name="category[category_name]" id="category_name" class="text required" value="<?php echo isset($arrItemInfo['category_name'])?$arrItemInfo['category_name']:null; ?>">
        </div>
        <div class="element">
            <label for="category_description">Description:</label>
            <textarea name="category[category_description]" class="textarea" id="category_description"><?php echo isset($arrItemInfo['category_description'])?$arrItemInfo['category_description']:null; ?></textarea>
        </div>
        <div class="element">
            <label for="category">Category:</label>
            <select name="category[category_parent]" id="parent">
                <option value="">None</option>
                <?php foreach($arrCategories as $R): ?>
                <option value="<?php echo $R['category_id']; ?>" <?php if(isset($arrItemInfo['category_parent']) && $R['category_id'] == $arrItemInfo['category_parent']): ?>selected<?php endif; ?>>
                    <?php for($i=0; $i<$R['category_level']; $i++): echo '&nbsp;&nbsp;&nbsp;'; endfor; ?>
					<?php echo $R['category_name']; ?>
                </option>
                <?php endforeach; ?>
            </select>
        </div>
        <div class="element">
        	<label for="category_status">Status</label>
            <select id="category_status" name="category[category_status]" class="required">            
            	<?php 
				$arrStatus = Categories::getInstance()->getListStatus();
				foreach ($arrStatus as $key=>$R): ?>
                <option value="<?php echo $key; ?>" <?php if(isset($arrItemInfo['category_status']) && $arrItemInfo['category_status'] == $key): ?>selected="selected"<?php endif; ?>><?php echo $R; ?></option>
                <?php endforeach; ?>
            </select>
        </div>
        <div class="entry">
            <input type="hidden" name="id" id="id" value="<?php echo isset($arrItemInfo['category_id'])?$arrItemInfo['category_id']:null; ?>">
            <button type="submit">Save</button> <button>Cancel</button>
        </div>
    </form>
</div>